package top.huntwolf.admin.pojo;



import org.apache.shiro.authc.AuthenticationToken;
import top.huntwolf.admin.utils.TokenUtil;

/**
 * 封装用于供shiro校验的JWTToken,内容与返回前端的token一致
 */
public class JwtToken implements AuthenticationToken  {
    private String token;
    private String userName;

    public JwtToken(String token) {
        this.token = token;
        this.userName = TokenUtil.getCMSUserName(token);
    }

    @Override
    public Object getPrincipal() {
        return this.userName;
    }

    @Override
    public Object getCredentials() {
        return this.token;
    }
}
